/**************************************************************************
#    Copyright 2010-2011 Raphaël François
#    Contact : ctrlbrk76@gmail.com
#
#    This file is part of VstBoard.
#
#    VstBoard is free software: you can redistribute it and/or modify
#    it under the terms of the under the terms of the GNU Lesser General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    VstBoard is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    under the terms of the GNU Lesser General Public License for more details.
#
#    You should have received a copy of the under the terms of the GNU Lesser General Public License
#    along with VstBoard.  If not, see <http://www.gnu.org/licenses/>.
**************************************************************************/

#include "modifierswidget.h"
#include "ui_modifierswidget.h"

ModifiersWidget::ModifiersWidget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::ModifiersWidget)
{
    ui->setupUi(this);
}

ModifiersWidget::~ModifiersWidget()
{
    delete ui;
}

void ModifiersWidget::SetData(int mb)
{
    ui->shift->setChecked(mb & Qt::ShiftModifier);
    ui->ctrl->setChecked(mb & Qt::ControlModifier);
    ui->alt->setChecked(mb & Qt::AltModifier);
}

int ModifiersWidget::GetData()
{
    int ret=0;
    if(ui->shift->isChecked()) ret+=Qt::ShiftModifier;
    if(ui->ctrl->isChecked()) ret+=Qt::ControlModifier;
    if(ui->alt->isChecked()) ret+=Qt::AltModifier;
    return ret;
}
